<?php
/**

This Library Class is written by Ananda Chakraborty helps by Joydebda
include this library class helps for all types of Validation,Image Upload , 
**/
/*require("fpdf/fpdf.php");
//include 'connection.php';
include_once ("jpgraph/jpgraph.php"); 
include_once ("jpgraph/jpgraph_pie.php"); 
include_once ("jpgraph/jpgraph_pie3d.php"); */ 

class Mylibrary 
{
	var $Query_ID = 0;          // Result of most recent mysql_query().
	var $Record   = array();  // current mysql_fetch_array()-result.
	
//------------------------------------Every Type of Field Validation-------------------------------	
	
	//Email Validation
public function emailValid($email)
{
	
$pattern="/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/";
if(preg_match($pattern,$email))
return true;
else
return false;
}

//Integer Number Check
public function numCheck($value)
	{
	   if(preg_match("/^[0-9]*$/",$value))
	   {
	   	 return true;
	   }else
	   return false;

	}
	
	// Decimal Number check
	public function floatCheck($string)
	{
		$pattern = "/^[0-9]+\.[0-9]{1,2}$/";
		if(preg_match($pattern,$string))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	//Field Empty Check
	public function fldEmptyCheck($string)
	{
		if(trim($string!=''))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	//------------------------------------End of Every Type of Field Validation-------------------------------	//

}